;;; $Id: repl.sld 66 2012-07-19 16:05:17Z alan.watson.f $

(define-library (oaxaca repl)

  (export repl
          interaction-environment)

  (import (scheme base)
          (scheme eval))

  (cond-expand (chibi (import (oaxaca repl-chibi))))

  (begin

    (define (repl)
      (repl-helper (interaction-environment)))

    ;; The interaction-environment procedure defined here mirrors the
    ;; one in the (scheme repl) library, but is more suitable for
    ;; Oaxaca. See also the (oaxaca load) library.

    (define the-interaction-environment #f)

    (define (interaction-environment)
      (unless the-interaction-environment
        (set! the-interaction-environment
              (environment '(scheme base)
                           '(scheme case-lambda)
                           '(scheme char)
                           '(scheme complex)
                           '(scheme division)
                           '(scheme eval)
                           '(scheme inexact)
                           '(scheme lazy)
                           '(scheme process-context)
                           '(scheme read)
                           '(scheme repl)
                           '(scheme time)
                           '(scheme write)
                           '(oaxaca ao)
                           '(oaxaca file)
                           '(oaxaca load)
                           '(oaxaca log)
                           '(oaxaca repl)
                           '(oaxaca wfc)
                           '(oaxaca wfs))))
      the-interaction-environment)))
